/*
package com.lx.chong.utils;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.joriving.pdf.VO.SocketVO;
import com.joriving.pdf.enums.ResultEnum;
import com.joriving.pdf.exception.PdfCommonException;
import com.joriving.pdf.utils.websocket.SocketUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.concurrent.CountDownLatch;

*/
/**
 * Redis消息的接收者
 * @author: whh
 * @date: 2018/1/16
 *//*

@Slf4j
public class RedisReceiver {

    public static final String REDIS_PREFIX = PropertiesUtil.get("MD5Str", "/common.properties");

    private CountDownLatch latch;

    @Autowired
    private SocketUtil socketUtil;

    @Autowired
    private ObjectMapper objectMapper;

    @Autowired
    public RedisReceiver(CountDownLatch latch) {
        this.latch = latch;
    }

    public void receiveMessage(SocketVO socketVO) {
        System.out.println("Received <" + socketVO + ">");
        log.info("[redis订阅者接收信息]:Received <{}>", socketVO);
        try {
            if(socketVO!=null){
                socketUtil.sendMessage(objectMapper.writeValueAsString(socketVO));
            }
        } catch (JsonProcessingException e) {
            throw new PdfCommonException(ResultEnum.REDIS_RECEIVE_ERROR);
        }
        latch.countDown();
    }
}
*/
